package com.demo.app;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

@Controller
public class AppController {
	
	@RequestMapping("test")
	@ResponseBody

	public String test() {
		return "test";
		
	}	

	@RequestMapping("test1")
	@ResponseBody
	public String test1() {
		RestTemplate restTemplate = new RestTemplate();
		
		String result = restTemplate.getForObject("https://127.0.0.1:8080/app/home",String.class);
		
		return result;
	}
	
	@RequestMapping(name="test2")
	public String test2(Model model) {
		String xx = "调试";
		model.addAttribute("name", xx);
		return "app";
	}
	@RequestMapping("test3")
	public String test3() {
		return "user/user";
	}
}
